//
//  HSYBaseWebController.m
//  高仿暴走斗图
//
//  Created by huangsongyao on 16/3/4.
//  Copyright © 2016年 huangsongyao. All rights reserved.
//

#import "HSYBaseWebController.h"

@implementation HSYBaseWebController

- (instancetype)initWithURL:(NSURL *)url {
    
    if (self = [super init]) {
        
    }
    return self;
}


- (void)viewDidLoad {
    
    [super viewDidLoad];
    
}

- (void)createWebViewForURL:(NSURL *)url {
    
    [self createWebViewWithSubView:self.view frame:self.view.frame url:url];
}

- (void)createWebViewWithSubView:(UIView *)view frame:(CGRect) frame url:(NSURL *)url {
    
    if (self.webView || !view || !url) {
        return;
    }
    self.webView = [[UIWebView alloc] initWithFrame:frame];
    if (url) {
        NSURLRequest * request = [NSURLRequest requestWithURL:url];
        [self.webView loadRequest:request];
    }
    
    [view addSubview:self.webView];
}

@end
